<?php
/*!
 * Theme Name:One Nav
 * Theme URI:https://www.iotheme.cn/
 * Author:iowen
 * Author URI:https://www.iowen.cn/
 */
if ( ! defined( 'ABSPATH' ) ) { exit; }?>
<?php get_header();?>


<?php 
include( get_theme_file_path('/templates/sidebar-nav.php') );
?>
<div class="main-content flex-fill">
<?php get_template_part( 'templates/tools','header' ); ?>  
                <div class="card mb-4 p-title">
                    <div class="card-body">
                        <h1 class="text-gray text-lg m-0"><?php single_cat_title() ?><span style="font-size:.875rem;margin-left:5px;"><?php echo strip_tags(trim(category_description())); ?></span><span style="float: right;">Ctrl+D 收藏本页</span></h1>
                    </div>
                </div>
        <?php
        // 加载网址模块  
                $children = get_categories(array(
                    'taxonomy'   => 'favorites',
                    'meta_key'   => '_term_order',
                    'orderby'    => 'meta_value_num',
                    'order'      => 'desc',
                    'child_of'   => get_queried_object_id(),
                    'hide_empty' => 0
                ));
                if( $children ){  
                    foreach($children as $mid) { 
                        fav_con_class($mid);
                    } 
                } 
        ?>   
    </div>
<style>
ul,li{list-style:none;padding:0;margin:0}
.sort{position:fixed;top:50%;width:32px;margin:0;border-radius:8px;z-index:998;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:all .3s;-moz-transition:all .3s;-o-transition:all .3s;transition:all .3s}
.sort li{position:relative;margin:4px 2px}
.sort li a{position:relative;display:inline-block;text-align:right;background:rgba(255,255,255,.85);padding:6px 8px 6px 6px;box-shadow:0 0 8px #ccc;border-radius:0 25px 25px 0;white-space:nowrap;-webkit-transition:all .3s;-moz-transition:all .3s;-o-transition:all .3s;transition:all .3s;-webkit-transform:translateX(-100%) translateX(30px);-moz-transform:translateX(-100%) translateX(30px);-o-transform:translateX(-100%) translateX(30px);transform:translateX(-100%) translateX(30px)}
.sort li a:hover,.sort li a.active{color:#fff;background:#ff7f00}
.sort li a:hover{-webkit-transform:translateX(0);-moz-transform:translateX(0);-o-transform:translateX(0);transform:translateX(0)}
 @media(min-width:768px){.content-site{padding: 0 50px;}}
</style>
<ul class="sort"></ul>
<script>
function gotomylove(obq){$("html,body").animate({scrollTop:$('#'+obq).offset().top-80},500);}
var html="";
$("#content .site-tag").each(function(){html+='<li><a href="javascript:gotomylove(\''+$(this).attr("id")+'\')" class="move"><span class="text-xs">'+$(this).parent("h4").text()+'</span></a></li>';});
$(".sort").append(html);
</script>
<?php
get_footer();
